package org.homly.admin.tag.product;

import java.util.HashMap;
import java.util.List;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

import org.homly.sql.SQLTool;

/**
 * 显示产品品牌列表
 * @author Dragon
 * @date 2012-11-14
 *
 */
@SuppressWarnings("serial")
public class ProductBrandListTag extends TagSupport {

	private String name = "rows";
	
	@Override
	public int doStartTag() throws JspException {
		try {
			String sql = "select distinct product_brand_name from product where product_status=1 order by product_brand_name";
			List<HashMap<String, String>> list = SQLTool.query(sql);
			pageContext.setAttribute(name, list);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return super.doStartTag();
	}

	public void setName(String name) {
		this.name = name;
	}
	
	
}
